home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / c / RConfig.lha / RConfig_v1.1 / include / alloca.h next >
Encoding:
C/C++ Source or Header  |  1992-09-13  |  852 b   |  38 lines

  1. /*
  2.  * RConfig -- Replacement Library Configuration
  3.  *   Copyright 1992 by Anthon Pang, Omni Communications Products
  4.  *
  5.  * Source File: alloca.h
  6.  * Description: alloca()
  7.  * Comments: Unix-like alloca() function, where allocated memory is
  8.  *   automatically free()'d when the procedure exits.
  9.  */
  10.  
  11. #ifndef __ALLOCA_H
  12. #define __ALLOCA_H
  13.  
  14. #ifndef __STDIO_H
  15. #include <stdio.h>
  16. #endif  /* __STDIO_H */
  17.  
  18. #ifndef __ALLOCA_REPLACE
  19. #define __ALLOCA_REPLACE
  20. #endif
  21.  
  22. #ifdef __SAFE_ALLOCA
  23.  
  24.     /* prototype for internal use */
  25.     void *_alloca(long *_return_address, size_t _size);
  26.  
  27.     /* This version requires a little work by the programmer */
  28. #   define alloca(v,s) _alloca( (long*)((((long)(&(v)))&~1L)-4), (s) )
  29.  
  30. #else
  31.  
  32.     /* This version makes assumptions about a5 */
  33.     void *alloca(size_t _size);
  34.  
  35. #   endif  /* SAFE_ALLOCA */
  36.  
  37. #endif  /* __ALLOCA_H */
  38.